-- curl -i '127.0.0.1:6699/api/tt/val'
local val    = require "validator"

local F    = require "base_funs"

local _ = require ("moses")


-- ngx.say("Hello val!")

-- res = val:__chk_require(" ", "YY")
-- _.each(res,ngx.say)


local res = val:__chk_num("STR", "YY")
-- _.each(res,ngx.say)


local ls = F.explode("||", "a,b|c||ERT||ui||OP||TYE||IOP||IPO",99)
_.each(ls,ngx.say)



local days = {
   "Monday", "Tuesday", "Wednesday", "Thursday",
   "Friday", "Saturday","Sunday"
}
local s = F.implode( ',', days)
ngx.say("s == ".. s)

ngx.say(ngx.time())
ngx.say(ngx.localtime())
ngx.say(F.get_timestamp2())

-- local tmp = F.ltrim("  r ui_Wasabi   ") 
-- ngx.say("ltrim==" .. tmp)

-- local tmp = F.rtrim_ngx(" 23456789 Wasabi   ")  
-- ngx.say("rtrim_ngx==" .. tmp)


-- local tmp = F.trim_ngx(" 23456789 Wasabi   ")  
-- ngx.say("trim_ngx==" .. tmp)
-- _.each(ls, ngx.say)